package com.snail.model.entity;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.util.Date;

/**
 * @author cici
 * @description 订单
 * @date 2025/8/19 15:55
 */
@Data
@Document(indexName = "biz_order")
@AllArgsConstructor
@NoArgsConstructor
@JsonIgnoreProperties(ignoreUnknown = true)
public class OrderDetail {
    @Id
    @Field(name = "order_id", type = FieldType.Long)
    @JsonProperty("order_id")
    private Long orderId;

    @Field(name = "user_id", type = FieldType.Long)
    @JsonProperty("user_id")
    private Long userId;

    @Field(name = "product_name", type = FieldType.Text, analyzer = "ik_max_word", searchAnalyzer = "ik_smart")
    @JsonProperty("product_name")
    private String productName;

    @Field(name = "description", type = FieldType.Text, analyzer = "ik_max_word", searchAnalyzer = "ik_smart")
    @JsonProperty("description")
    private String description;

    @Field(name = "price", type = FieldType.Double)
    @JsonProperty("price")
    private Double price;

    @Field(name = "update_time", type = FieldType.Date)
    @JsonProperty("update_time")
    private Date updateTime;

    @Field(name = "type", type = FieldType.Keyword)
    @JsonProperty("type")
    private String type;
}
